package identity

import (
	"time"
)

// https://www.zstack.io/help/dev_manual/dev_guide/v4/6.1.html#concept_cxv_s1h_yz__p_ejt_l5p_3gb
type SessionInventory struct {
	Uuid        string
	AccoutUuid  string
	UserUuid    string
	ExpiredDate time.Time
	CreateDate  time.Time

	noSessionEvaluation bool
}

func NewSessionInventory(vo *SessionVO) *SessionInventory {
	return &SessionInventory{
		Uuid:        vo.Uuid,
		AccoutUuid:  vo.AccoutUuid,
		UserUuid:    vo.UserUuid,
		CreateDate:  vo.CreateDate,
		ExpiredDate: vo.ExpiredDate,
	}
}

func (si *SessionInventory) IsAccountSession() bool {
	return si.AccoutUuid == si.UserUuid
}

func (si *SessionInventory) IsUserSession() bool {
	return si.AccoutUuid != si.UserUuid
}

func (si *SessionInventory) IsNoSessionEvaluation() bool {
	return si.noSessionEvaluation
}
